make logic getting partial name a bit safer