after changing thread functions