bug fix in threadsimulator