copy arguments to prevent side-effects