trim whitespace from input names in getSubtreeForNames