Add functions to update threads