add duplicate frame detection