fix some indenting and duplicate order test in edit