Reinstating old login code