fix lỗi thread