fixed bugs in build script
updated build script