added fixes to maintain ordering