fix event binding in modal.js