added validation for login and registration screens.