init for both login and new