fix cast warning