Better fix for the previous identified bug.