counter login code  modified