fixed memory leak issue
remove socket descriptor on close
removed debug output