bug fix for current frame calculation.