fixing json data encoding