fix last inventory bug