prepare for invert