Fixed the logic so the click-to-edit/add event functionality works.