Fix 'number waiting longer than' logic

Change-Id: I9228a077bbe1f6457ea93e3cae89d47d70ea3a0e