Added proper Logout functionality