fix bug in event display function