Fix: use writeAndFlush