fix the pointer problem