update thread func