Added a logoff function