fixed animation duration calculation