fix pointer handling