updated logout to use a dialog with the back button