add logout function, #2