html_entities preserv and revert improved