fix saving of rule (JSON generation, guid, etc.)