save statusCode if error