fix js inversion