Adding validator functiona and login form