fix possible i/o error trim logs