Can you copy and paste here the "garbage" that you are seeing?

Have you tried debugging the code by having a print statement that prints out the value of data.get(index) before it is used in the...