bugfix: timediff caculation