added edit and update functionality