The technical problem of the present invention to provide a medical device, which exhibits an increased safety of the device and facilitates a safe use is solved by medical device for delivering at least one drug agent, comprising a sensor, a control unit and an attachable dispense assembly, wherein the sensor is configured to detect attachment of the dispense assembly to the medical device, wherein the control unit is configured to determine at least based on a signal from the sensor whether the end of life of the dispense assembly is reached and wherein the medical device is configured to indicate the end of life of the dispense assembly. The technical problem is further solved by a method according to the invention.