thread safe build