implemented edit and update