Fix a bug when res.threads is undefined
Merge pull request #29 from AnyFetch/bug-threads

Fix a bug when res.threads is undefined