detect on document ready