Remove error sort

I'm getting "comparison of Hash with Hash failed" for this sort method. Not using Rails.