defaults dest file to src file when none provided

Adds a simple check in the replace function to determine whether a destination file was given, if not the source file path is used by default