Fix insertRule bug