Add document ready check