Time bug fix