random loop now not endless if no results