change thread logic