fixed bug with array