add login/logout ability

need to fix bug with the logout feature