fix sorting of character values returned by api