Added appendFile method