added detection of dynamic instantiation