Added edit and update functionality