added connection.on('end') callback