use ptr to calloc memory