fix a bug at reinitialization