fix calc elapsedTime