The detection of correct alignment of the housing components is addressed in a medical device (1100) for treating a user. The medical device (1100) comprises a first housing portion (1101) adapted to be carried by a user and a second housing portion (1102) configured to be selectively operatively engaged with and disengaged from the first housing portion (1101). A magnetic source (1120) having at least one of a certain magnetic field and a certain magnetic strength provided on at least one of the first housing portion (1101) and the second housing portion (1102) and a sensor (1110) for detecting at least one of the certain magnetic field and the certain magnetic strength provided on the other of the first housing portion (1101) and the second housing portion (1102). In addition there is circuitry configured to provide a first signal in a case where the first housing portion (1101) and the second housing portion (1102) are brought together and the sensor (1110) detects at least one of the certain magnetic field and the certain magnetic strength of the magnetic source (1120), the circuitry further being configured to provide a second signal in a case where the first housing portion (1101) and the second housing portion (1102)are brought together and the sensor (1110) detects at least one of a magnetic field different from the certain magnetic field and a magnetic strength different from the certain magnetic strength of the magnetic source (1120).