fixed some event handling bugs