correcting conversion code