check for device ready than document ready