use parallel instead of multicore lapply