fix overwriting timestamp bug