handle ptr to struct better