fix integer division error