Correctly dereference the thread object