raise exception if schema not valid