OK, solved it. It's obvious now...
it was not obvious to me that a def relying on a defstate is no good idea...
What was the problem?