Added handling of multiple sets of rules for same folder