Updated new file function.