         location: makeDescriptionUrl httpServer
         server: makeServerString dev
         ext: ''
-        usn: config.uuid + (if config.uuid in [ customHeaders.nt, customHeaders.st ] then '' else '::' + customHeaders.nt or customHeaders.st)
+        usn: config.uuid + (if config.uuid is (customHeaders.nt or customHeaders.st) then '' else '::' + (customHeaders.nt or customHeaders.st))
 
-    # headers that are always used
-    includeHeaders = [ 'cache-control', 'server', 'usn', 'location' ]
-    # add passed headers to list of headers to include
-    for key of customHeaders
-        includeHeaders.push key
+    # specified headers are included in every request, merge them with headers passed to function
+    includeHeaders = ['cache-control','server','usn','location'].concat Object.keys customHeaders
 
     # build message string
     message =

    for header in includeHeaders
        message.push "#{header.toUpperCase()}: #{customHeaders[header] or defaultHeaders[header]}"

    # add carriage returns and new lines as required by HTTP spec
    debug message.join(', ')
    message.push '\r\n'
    new Buffer message.join '\r\n'



# send 3 messages about the device, and then one for each service
makeNotificationHeaders = (dev) ->
    [ 'upnp:rootdevice'
      config.uuid
      device.makeDeviceType dev.type
    ].concat config.devices[dev.type].services

# create a UDP socket, send messages, then close socket
sendMessages = (messages, address, port) ->
