fix inverse bug