process response errors correctly