the static cast at the right place

@olafmandel