Fixing HTML string to DOM utility function