Fix the bug for the event detection。