fix the sequential version