fixed bugs related to event handling