Fix a bug in time