copy dictionary because it is mutable