AI sight percerption

I have a zombie with a perception component that has sight and hearing. The sight by itself works fine and the hearing triggers correctly when I fire the gun but the sight also triggers even if the zombie can’t see me. It also sees and loses sight of me in an endless loop. I tried debugging the code but I don’t know what’s happening.