altered createContents to automatically start LGR and connect to socket