CSPACE-5887: Update event listener with updated logic also used in PAHMA-734.