invalid pointer fixed