final code for inventory update UI