How to stop enemies when they are not on the screen in Behavior Tree and Optimization

I’m using this to determine the distance and I tried both posses-unposses and stop logic after this, None of it worked. AI continue to do what it’s told.