fixed dimension calculation error