Fix security event check