Fixed Undefined index warning