finish logout functionality