small fix to avoid "Invalid argument supplied for foreach()" warning