bug for logoff function