modified edit functionality