Throw error if attr is missing its name
Reference escapeStr correct