fixing magnitude issue