changed if to while on .next() so we travserse a set of resutls rather than view the top result