fixed EOF issue