Adding login/logout logic