Added a check on files with the same name