mod loginout logic