Fix whitespace
Move the prefix assignment out of the try block for socket creation