added login validation and admin model