fix incorrect number of items returned