whoops! forgot to handle case where array is not object