conditions for running the queue