added waiting queue handling