clone things to prevent fighting a pass by ref error again