remove global variable from document ready