fix 2.18 type casting