Fix setting status code