more robust build script.