Fixing the endless loop issue when rewinding twice