There are a few reasons why a cake can sink in the middle. Check that your baking powder is in date, if not it can affect how the cake rises. Also, using too much baking powder can cause a cake to sink, so ensure you are using a level teaspoon(s) as per the recipe. Only beat the cake briefly between stages and at the end stage, overbeating can cause a cake to sink. Ensure that you don't open the oven door whilst the cake is baking, a sudden drop in temperature can cause the cake to sink. Ensure that your oven is at the right temperature, an oven thermometer can be useful to ascertain this. But, very often, even if it has sunk in the middle it will still taste delicious!