modify login/register/locate logic