don't use require from within a method

especially as socket is required by default