fixing a bug with timestamp