   @broadcast = (groupSlug, event, message)->
     if groupSlug isnt "koding"
       @one {slug : groupSlug }, (err, group)=>
-        if err then console.error "unknown group #{groupSlug}"
-        else if group.privacy isnt "private" or group.visibility isnt "hidden"
+        if err or not group then console.error "unknown group #{groupSlug}"
+        else if group.privacy isnt "private" and group.visibility isnt "hidden"
           @oldBroadcast.call this, "koding", event, message
     @oldBroadcast.call this, groupSlug, event, message
 

      unless err
        for admin in admins
          admin.sendNotification event, contents
 
  updateBundle: (formData, callback = (->)) ->
    @fetchBundle (err, bundle) =>
      return callback err  if err?

  createMembershipPolicy:(requestType, queue, callback)->
    [callback, queue] = [queue, callback]  unless callback
    queue ?= []

    JMembershipPolicy = require './membershippolicy'
    membershipPolicy  = new JMembershipPolicy
    membershipPolicy.approvalEnabled = no  if requestType is 'by-invite'
