fixed a warning on unknown constant
fixed a warning on non existent index