Md sorting: fix issue