add logout function, #1