Modifying socket functionallity to address issue