fix preserving order