added check dimension
added tests for check dimension