set correct response code