Editing now working

Updated code on write-edit.php