logout functionality with isAuthenticated service