improve socket module patching