fix illegal pointer