Change rule insert to upsert
Change order when posting a rule