fixes json_encode to array problem. #11824