clear thread on thread changing