moved datafile sanity check one line up