fixed build script, returned error when used with npm