Fixed Threading issue