more bug fixes to escape tags