replace 500 code with 400