handle responses properly