added support for _INSTANCE_INDEX variable