Fix undefined index warning