fix instantiation bug