fix dimension mismatch