fix inversion