finished logout function