Fixed issue with sorting columns in ascending or descending order