fixing sorting issue, can't believe it was in there for so long