Add method withRules

Add method withRules to add rules dynamic