don't write data if channel is not open