Fixed threadsafe build