Fixed bug where response code would not be sent