restore pointer when done