Add waiting mechanism to avoid failure.