apply sort when appending and reseting