Fix string indices must be integers

I accidentally used the name of the thread instead of the actual thread.