add dimention check