fix bug and remove inference cache