fixed some bugs about time