Added index to addRule to ensure order of rules