Use filterEvent for filtering events