I need to plug an [OpenCM9.04 A-type board](https://emanual.robotis.com/docs/en/parts/controller/opencm904/) into an [OpenCM485 expansion board](https://emanual.robotis.com/docs/en/parts/controller/opencm485exp/) and connect some cables to the gpio sockets. From the manufacturer, the gpio sockets on the OpenCM 9.04 board are through holes and the 485 expansion board has the PCB socket pre-soldered on and I do not intend to remove it unless I have to.

My current solution is shown in the pictures. I soldered some long pin PCB headers with soldering pads on the other end onto the OpenCM 9.04 so that I can plug the board onto the expansion board. Then I solder wires to the soldering pads. However, it is not a pleasure to solder the wires, and the wires may come loose if the board is not carefully handled. What would be the recommended solution to this?

[![enter image description here](https://i.stack.imgur.com/BgI3A.jpg)](https://i.stack.imgur.com/BgI3A.jpg)
[![enter image description here](https://i.stack.imgur.com/ZIksm.jpg)](https://i.stack.imgur.com/ZIksm.jpg)