update the reference of pointer