fix name substitution and avoid clobbering client