Adding document edit function