added hasRule & addRule method for validator