make sure we free the socket before mocking it
fixed the patching