The electrical code requires you to keep the connections in a junction box when you splice wires. The measure protects people from getting shocked by live wires and prevents fires when the wires are overheated.
Let's Get It Fixed!
HomeX virtual experts will assess your issue (for free!) and can resolve simple problems.