fix warnings of Type cast required