fallback for json_encode