fix require reference and socket connection