Add write to file function.