You need to add decoupling to each motor’s supply like the last one on this page De-coupling
As well as back EMF diodes.