fix duration() that broke with previous commit