added socket magic