wait for resources logic