Fixing ajax datatype issue