fixed bug in conversion