type cast bug