fixed nasty pointer issue