added close packet support