How long do caterpillars stay in their cocoons