Clone path before performing destructive operations on it