fixed tm loop