fix threading crasher