Update Type Casting Logic