rebuild script