fix IV being changed by making a copy of it