Stock count does not update after order is cancelled

If a customer orders an item, the stock count is automatically reduced by the amount ordered. However, if the order is cancelled, the stock count does not update automatically. As a result, it gives the incorrect stock count.