My mistake, this code adds the filename from the source if it's not present on the destination. We still need a better way to identify if destination contains refers to a file or directory.