modified handling of response code