added consistency check for input datasets