fix up cast