Deep copy peformance issue

simple fix if no dynamic API is required