fixed bugs when file do not have metadata fields