remove  invert function with error