Fixed the currentFrame bug