Hopefully fixed bug with linking to thread