add from mem func