fix recursion bug in converter