fixed wait_with_timeout
Merge pull request #1 from ncatlin/patch-1

fixed wait_with_timeout