Resolve notice of Undefined index: name