fixed some bugs related to event processing
removed console.logs