added inventory update javascript