fix response logic