check for readyState