fixed bugs in build process