added basic logic for inverse not stable