add debug wait queue code