fix another illegal cast