Fixed a bug in edit order