add timeout
Merge pull request #1 from GuyCheung/master

add timeout option