fix retrieval problem caused by wrong sorting of strings