fix run in other thread bug.