a clone function for command map