added edit state and accept edits