fixed the build script when rebuild action is triggered.