fixed EOF error