fix reinit bugs