why cast to IntPtr?