The present invention relates to drug delivery devices The drug delivery device according to the invention includes a housing with a needle holder suitable for attaching a needle unit to the housing at the distal end, and a cap being capable of covering the distal end of the drug delivery device and comprising a retaining member capable of securing the cap by engaging with the housing, the retaining member is prevented from engaging with the housing with the needle unit being attached to the needle holder. Furthermore, using a cap for covering the distal end of the drug delivery device is disclosed.