fixed bug for elapsed time measurement