fixing conversion errors