rebuild main