fix to check readyState

and a typo.