fixes TypeError: can't convert Array into Integer