setup edit state