AI collision detect

I have problem with second AI like on the picture:

When he is blocked by first AI, he can deal damage to me.
Square box is detecting area if player is in range, if true deal damage.
Anybody know why AI who is behind first one can also deal damage?