correct for bug - first dimension must be checked