Fixing bug when files are not supposed to be in the root of the folder