Added logout function