fix the process_worker_message function which must always get the first element from the queue