fix get_inverse bug