FIxed bug in setting pointer target to null