Fixed Logout Function