adds environment argument to ensureWorker