fix Undefined index