fixed crash at the end of playback