fixed the duration bug