fixed multi-thread crash bug.