Added exit if data dimensions mismatched