Fixed using wrong socket variable.