added flag dataset to extract dataset if required