changes filename if the name already exists