solved multi threading problem