An optimal control model with defective products and goodwill damages