make multithread compilable