fix some bugs about time span