Be sure to use baking apples that hold structure and don't get mushy (i.e. granny smith), correctly measure the amount of apples, don't underbake, and remove the cake from the pan to cool to allow the air to circulate.