I think you need to wait until the vout is ready. The fun part is, there is no clean way of knowing when it has been.