fixed bug that occured on writing metadata to netcdf file