make the event parsing more robust.