Improved index page logic to respond to multiple events.