change 'results.length' to results.size