fixed a bug in event propagation