Fixed the threading issue
Fixed merge