fix pointer type cast