Why am I getting this error message?

That was it.

Which, like you pointed out, is strange. Because the IsDead variable read just fine.