fixed bug in unit conversion