fixed eof() check bug in transmit