Fixed sending end of file message. It works