Added the logout function