Intro does not synchronize with looper

I have a little problem with an intro and its synchronization. The intro is structured as follows:
It’s a 4/4 bar and 170 beats. In the middle of the first measure, I count by hihat (1,2,3,4,5,6) and then the actual intro comes in for 8 measures.
Here I can see immediately that the LED of my looper is not on the beginning of the clock or the synchronization is not right. The flashing of the LED is about in the middle of the clock and thus the sync to the intro is not right. If I play the song without the intro then the synchronization is correct.
Is there perhaps a trick in Midifile or something else to consider for the synchronization?