   if singletons[name]?
     singletons[name]
   else
-    console.warn "[getSingleton] #{name} doesn't exist"
+    debug "could not found singleton #{name}"
     null
 
 module.exports =

  registerSingleton: (name, obj, override = no)->
    if (existing = singletons[name])?
      if override
        console.warn "[registerSingleton] overriding #{name}"
        existing.destroy?()
        singletons[name] = obj
      else
        console.error "[registerSingleton] #{name} exists. if you want to override set override param to true."
        singletons[name]
      # KDObject.emit "singleton.#{name}.registered"
    else
      # log "singleton registered! KD.singletons[\"#{name}\"]"
      singletons[name] = obj

  registerInstance: (inst) ->
    console.warn '[registerInstance] instance is being overwritten' if instances[inst.id]
    instances[inst.id] = inst

  unregisterInstance: (id) ->

debug = require('debug') 'kd'
utils = require './utils'
dom = require 'kd-dom'

