add new cast code