made small changes to make add event work