fix not to crash for queries without any results