modified the selection of constructor. take parent's instance's constructor as parent constructor not parent class itself because parent class itself might be factory method of the class.