add defensive check to verify array and not other "countable" value