fixed a bug with case insensitivity in the sort