Fixing error with empty results