Added time stamp writing