now multithread support works