added try-finally-block around every Dataset.loadIntoMemory/unloadFromMemory();