changed few bugs in convert