build script and fix bug