bug fix for wap when invert_hash is on
Merge pull request #198 from pierce1987/ih_wap_bug

bug fix for wap when invert_hash is on