Some changes in event handling