fixed a minor bug with the order of the results