fixed bug causing to crash when discover returns 0 rows