Fix an undefined index error