dynamic memory allocation when append new member