write stats data to temp file and than rename file name
update version