modify logout function