Added JS to edit events