fixed bug with decimal optimization