improve done cast.