add status code and error message