Fixes thread assigment issue