rebuild script fix