updated usages of connection.destroy() and connection.end(). also changed 'connectonClose' message to connection.fin()