You had fixed the issue when you reconnected that (black wire) motor connector back onto the motor lead. Make sure it's on there secure!
to not have this problem in the future, get some pliers and clamp down on the connector (again, the one attached to your black wire) and squeeze to make it slightly flatter.
After that, plug it back onto your motor. You should notice that it's harder to get on, but once it is, then it should be nice and secure, and not pop off on you again.