implement document edit