add rule function to add the validation rules