Logoff function updated.