save and restore the order