all we need now is truncating and log writing