remove unnecessary eos