fix event.js bugs