check if there are any unsaved changes before logout and add a function
to handle the 'no' even when a user wants to navigate away without
saving.