Avoid IE8 bug when deleting from window