add patch to hook close events