Fixing Undefined index: nids, line 1114.