unexpected error now using an appropriate response code