fix unchecked-cast warning