if clause for event links