added check for class of dat.array
added checks in createAtlas