fixed t-1 / perframe=NaN on last frame bug