bug fix in timing