cost: fix issue #325