check pointer cast