better response handling