fixed json_encode