added a check to ensure duration is never zero when decoded, thus hopefully resolving the divide by zero error