added debug option to build script