Changed code to add product id into the database as well.