add contiguity check