Add response-sent logic