Fix for: Invalid argument supplied for foreach()

Fix, when no results