fix inverted values