add local type to to and from subType function