Updated it to handle directories as a path instead of just single files.