Revert "Fix updating the context of threads and index"

This reverts commit e7b1c52dbf9f25aec32bea64c712ee4075f7ef6f.