Turn off sleep mode when closing the lid. Go to your Control Panel and navigate to Power Options. On the sidebar, select "Change what happens when you close your laptop's lid." Set the dropdown box to "Do nothing."
Also, depending on what OS you are running, sleep mode and hibernate may not be...