Added socket disconnect function