Add functionality to watch for unsaved canges