Try and use a Non Stick pan rather that a metal pan. When using a metal pan, bake the cupcake one or two minutes shorter than the baking time. Reasons for this suggestion is a metal pan gets much warmer that the non-stick pan and because the cupcakes also bake from the outside in, the heat stays on the side of the cake and it bakes even more until it is done on the inside. When using the foil cupcakes implement this arrangement as for metal pans even if you use a non-stick pan because the foil cups gets warmer that the normal grease proof paper.