->isNotEmpty() not working outside of foreach loop

Alright, thanks.