bad if condition on client for building the query, now instead of checking if is object, we use Array.isArray