NextFrame function added to timer.