resolve issue when echo statement is contained in a html string