add multithread support
update changes