Update dat file only when required