2000 Kia Sophia automatic won't shift

Ok long story short. Car with burnt engine (overheated, good automatic transmission(?). Replaced engine. Runs great but transmission won’t shift. It shifts from park into reverse, neutral and first and you can manually shift into second but wont shift into second, drive and overdrive on it’s own. Check and and OD light are on. Replaced transmission for a “good” one. Same problem. Any ideas at all? Thanks