Update logout function