updated build script, just need to fix threading problem