add close common callback