fixed null output when half-closing