require_relative suggests refactoring is needed but this works for now
more fixes to the socket code