fixed bug when sending json data to server