add typeError to load_header_func to avoid unicode issues.