Cupcakes often deflate when the batter is over mixed. By creating too much air in the batter, when they cool the air will release and they will deflate. It's important to only mix until just combined.