To prevent the cake from leaning, make sure to level the cake toppings. You also want to make sure to pour the exact amount of cake batter into each cake pans.