Fix problem when json is sent