fixed rebuild script