Function added so data can be edited and resubmitted to the database