I'd start by replacing the cord and receptacle. It was probably a loose connection, creating heat, makibg the connection looser. Make sure everything is rated for the current you expect your device to draw. Then measure how much current it is actually drawing to make sure it is working right.
Discussion
Thank you sir