Need to fix socket not closing