adding logic to see if files already exist