unused variable onEOF not removed everywhere