bug fix for upade inventory == 0