Move do_when_ready to end of the file

To address #110
Merge pull request #111 from jasonm/master

Move do_when_ready to end of the file