cast the string of type