cleanup sort workaround