Added login/out functionality