Fixing inv error