fixed a bug with inv helper