fix cast var