fix some issue about create primitive instance