fix SecondarySort bug by luc