added code to detect and repair EOL