fix bugs in timestamp