How do I print my result without these weird side effects after IO.gets?

I am trying to print my final results and whether I use IO.puts or IO.inspect I encounter issues after IO.gets. When the code runs through the program without issue then the result is fine but if an error is raised and it runs through IO.gets then issues come up. When I use IO.puts the :ok that comes at the end goes through part of the program for some reason and raises errors along the way. When I use IO.inspect the result prints twice and the second result is strange. I would rather run the IO.puts version but ultimately I would like to know for both, why does this happen and how do I work around it or fix it?

Here is the Github repo and ill show the weird results down below

I use the mix task "mix erovf “can put file path here or leave it blank and it will default”
I don’t think thats the issue but this is my first time using one and I could have easily messed it up
I will put the mix task here erovf/mix.task.erovf.ex at master · TinyBFG/erovf · GitHub

IO.puts result

 Video Files

c:/Program Files/internet explorer/mobile_test_folder/Mobile_test_normal_files/video1.mov



 Non-Video Files

c:/Program Files/internet explorer/mobile_test_folder/Mobile_test_videos/Ogre4.jpg
c:/Program Files/internet explorer/mobile_test_folder/Mobile_test_videos/Screenshot (9).png
c:/Program Files/internet explorer/mobile_test_folder/Mobile_test_videos/ocean2.wav
c:/Program Files/internet explorer/mobile_test_folder/Mobile_test_videos/song2.mp3


** (Protocol.UndefinedError) protocol Enumerable not implemented for :ok of type Atom. This protocol is implemented for the following type(s): Date.Range, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, List, Map, MapSet, Range, Stream   
    (elixir 1.12.2) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir 1.12.2) lib/enum.ex:141: Enumerable.reduce/3
    (elixir 1.12.2) lib/enum.ex:3952: Enum.reverse/1
    (elixir 1.12.2) lib/enum.ex:3311: Enum.to_list/1
    (elixir 1.12.2) lib/enum.ex:3896: Enum.flat_map_list/2
    (elixir 1.12.2) lib/enum.ex:3895: Enum.flat_map_list/2
    (erovf 0.1.0) lib/erovf.ex:58: Erovf.do_identifies_misplaced_files/1
    (mix 1.12.2) lib/mix/task.ex:394: anonymous fn/3 in Mix.Task.run_task/3

IO.inspect result

 Video Files

["c:/Program Files/internet explorer/mobile_test_folder/Mobile_test_normal_files/video1.mov"]
 
 Non-Video Files

["c:/Program Files/internet explorer/mobile_test_folder/Mobile_test_videos/Ogre4.jpg",
 "c:/Program Files/internet explorer/mobile_test_folder/Mobile_test_videos/Screenshot (9).png",
 "c:/Program Files/internet explorer/mobile_test_folder/Mobile_test_videos/ocean2.wav",
 "c:/Program Files/internet explorer/mobile_test_folder/Mobile_test_videos/song2.mp3"]

 Video Files

[]

 Non-Video Files

["c:/Program Files/internet explorer/mobile_test_folder/Mobile_test_videos/Ogre4.jpg",
 "c:/Program Files/internet explorer/mobile_test_folder/Mobile_test_videos/Screenshot (9).png",
 "c:/Program Files/internet explorer/mobile_test_folder/Mobile_test_videos/ocean2.wav",
 "c:/Program Files/internet explorer/mobile_test_folder/Mobile_test_videos/song2.mp3"]