Fix recursive 500 error