fix bug when name is array and some of index does not exist