replace the pointer to reference