adding code for showing events