queueWorker function