fix warning from compiler: cast the varible type