Fix the bug where the player repeats the first few seconds at the end