fix for m-m-m/mmm#130

fix for m-m-m/mmm#130: first setting the instance to prevent from instance override when looping instantiation