fixing memory, and adding data appender