fixing duration calculations