fixed bug in socket realisation