Correction to: Nature https://doi.org/10.1038/s41586-020-2866-8Published online 28 October 2020

In this Article, there were three issues with the references. First, citations to Ahmed et al. (2020)1 and Zipper et al. (2020)2, published while our manuscript was in revision, were missing, and have now been added as refs. 95 and 96 after the modified sentence: “Levels of the steroid hormone ecdysone, which promotes egg production and intestinal stem-cell proliferation, increase after mating”. Second, a citation to Kohl and Dulac (2018)3 was inadvertently deleted during the re-formatting of the Article and has now been added as ref. 94 after the sentence: “Internal state has profound effects on brain function”. Third, a typo in ref. 38 of the original Article (Davey and Treherne, 1964) has also been rectified. Finally, ‘reduce’ should have been ‘increase’ in the text: “Expression of a dominant-negative EcR—which targets all EcR isoforms—confined to the Ms neurons of adult flies was found to increase intracellular Ms levels...”. The original Article has been corrected online.