made a build script and fixed a bug