Refactored recursive processQueue flag as boolean.