Updated to use insertRule and deleteRule instead of addRule for compatibility reasons