completed login code