CheckThread module added to support threading

script changed to support threading