object array is not a function