simplify the parallel apply function in the case when n_jobs = 1