remove redundant close of socket