fixes for many threads