update the app to handle empty queries to the send mail function