Fixed bug in keeping track whether a stage uses a cached dataset or not for logging