Updated thread to avoid undefined errors
Merge pull request #135 from nathantross/threadErrors

Updated thread to avoid undefined errors