change the way to do handle CheckCast