wrapping code for clone.js