Fixed a bug that can't enable scoping in insertRichFile