fix a bug of wrongly numbering when instantiating