Added better login manaagment