   callback(message)
 
 startHeartbeat = (userId,clientId) ->
+  setTimeout ->
+    refreshPresence(userId,clientId)
+  , 2000
   setInterval ->
     refreshPresence(userId,clientId,this)
   , 30000

refreshPresence = (userId,clientId,hearbeatInterval) ->
  mongodb.collection 'users', (err, collection) ->
    console.log err if err
    collection.findOne { _id: userId }, (err,user) ->
      console.log err if err
      checkStatusAndBroadcast(user,clientId,hearbeatInterval) if user != null


          clearUserHeartbeat(user,clientId)
          broadcastStatus(user,"offline")

      clearInterval(hearbeatInterval) if hearbeatInterval

setUserHeartbeat = (user,time) ->
  userId   = user._id
