Fix event detection