added calls to setSocket