Added logic for updating edits table