added setRules and allowed empty rules and messages