fix closeByDocument and close button