Why sodium propionate is used in cakes?

It's added to cake as a preservative to increase the shelf life of the cake by inhibiting the growth of Mold