correct `Undefined index` exception