Help with not having an object disconnect

The first picture is before rotating, and when I rotate the arm disconnects from the main body. How do I make it stretch instead of disconnect?