add multithread and serialization but have some problem