Added logout function.