handle excess whitespace in setPrefixResult
handle excess whitespace in setPrefixResult