IDEX-1144 added check size of array