multi-thread is so hard to deal with