Correction 1

Filepath had to be a directory, if it was pointing to file, the add-on
crash.
Now if the filepath point to a file, only the directory where the file
is will be used