Adding a waitFor method.