EDM detection does not detect content at the end of a file