adding public method to return dynamic objectinstance