Logout func fixed