fix the status code inversion