fix logic error in handling of response