I can only assume that your laptop goes to sleep when you close the lid. This is standard behavior for a laptop.
You can choose to disable this from Power Options in the Control Panel.
You can further disable sleep and hibernation from Control Panel -> System -> Advanced System Settings.