fixed EOF usage