add a check for arrays