fix duration bug