implemented edit functionality