skip_closed option from @sampsyo's fork