fix to check readyState
Merge pull request #170 from nkzawa/patch-0

fix to check readyState