Updated edit functionality