create a function to support dynamic instantiation
add dynamic instantiation support