Use escapeHTML instead of encodeEntities