Added a conditional for signing out in the menuitem click handler for sign out feature