Corrected code to prevent non=epub files from breaking the directory scanner.