Added missing version check for json_encode