adds edit functionality