validator applied to login, register