Cast correctly