prevent getSelection from breaking IE8