sorting moved to upper scope, and is persistent after changing tab