bug fix for incorrect frame duration calculation