added check for arrays in parameters