Fixed incorrect multithread work