fix threaded issues