Prevent Accidently Losing Work

Implemented code to prevent losing unsaved work by switching menus.