fix for not letting go of socket