Add a slightly more sophisticated wait strategy