Thread cursor fix