Added readyState check in domready