fixing pointer issue