Fixing multiple pointer issue