Sorry, Pappenhiemer, Im NOT knocking your code!
It looks fine, and its easily understandable, but I dont see how it will
help him, if my understanding of the engines auto-terminate is correct.
I suspect there is another function at work here triggering the error,
that is remembering this entity in something other than 'me' or 'you'.
Without more code I cant be sure.
So :::
If Pappenhiemer's solution doesnt work, then I need more code...