fixed EOF issue with md