Make code more smaller

That's because the object you tried to subscript is not declared as an array.