Fix NPE bug in dataset activity