fix errors with queue length