added back file writing fro timestamp