add build script and fix some bug