a bug with event handlers