fix in counting duration