Added some logic for responding