fixed error handling in dataset creation