The problem is solved here if we use `clone`. `dup` doesn't seem to exist.