++added onLogout method