[bug[ Check for already existing files and folder before rename.

Fixes #2560