Add code to handle watching for a quitting application.