used more common way to detect array-like objects