bug fix for arrays