I guess you should test which the FILEPATH is finishing with backslash "\\", right? I dont see any validation here or in read_file.