Fixed bug with json not escaped properly