Added check in multiply() to make sure the product is defined