Fix waitFor
Merge pull request #62 from gaye/fix-wait-for

Fix waitFor