fixed some bugs with response processing