Loose connections cause arking which creates high amperage and excessive heat, causing the wire nuts to melt. Be sure to check for loose connections. Cut off any damaged wire and securely reconnect with a new wire nut. The connection must be tight. You should not be able to pull wires apart.