fix on the sql for the waiting list