Fix closest method for IE8