fixed bugs in event model