Implemented logout.