Why there is difference when the code is correctly converted?