deal with end of video properly