You don't need a loop here because the event should occure any time when any entity impacts with the wall.

And yes, the "my.emask = NULL;" is not needed here.