sortbytree parameter added and undo re-instated for sort by tree and sort by id