Fixed the rotating bug