bug fix in array handling