fixed selection bug for HTML round-trip selection