Fixed bug in edit order