better handle escaping of '#'