fix doc problem and make joblib threadsafe