modified func ...save_header