adding initial code for event managing