update product function