new append data function to avoid memory leaks