Correct behaviour of string caching

Previously didnt account for the string belonging to a domain