added all the event handlers to the root object instead of document