pointer cast fix