fixing few problems and saving the data file name in one place