added event monitoring and actioning logic.