logout function completed