fix auto-retrieval of code