I got a clue at to what is wrong. I didnt both encoding the array data