fixing error on array