Checking readyState before sending