Updated the function that loads the file