Add append to file function