New logout functionality