fix yet another cast issue