Added an additional error checking for product type.