fix copy function in util.js

we needed to use path.resolve
and not worry about the existence of files.basepath