correction to as.data.frame.dataset