Change socket constructor