check for array or object