added refresh path code to new build script, too
explicitly throwing if  is non 0