add the plan edit function