 
     # will be removed soon, use getToken instead
     app.post '/registerGCM', authorize('register'), (req, res) ->
-
         logger.verbose "registerGCM: " + JSON.stringify(req.body)
         try
             fields = {}
             fields.proto = "gcm"
             fields.token = req.body.pushToken
             createSubscriber fields, (subscriber, created) ->
+
+                if created == false
+                    subscriber.getSubscriptions (subs) ->
+                        for sub in subs
+                            subscriber.removeSubscription sub.event, (deleted) ->
+                                if not deleted
+                                    logger.error "No subscriber #{req.subscriber.id}"
+
                 subscriber.get (info) ->
                     info.id = subscriber.id
                     if req.body.pushTopics?

            res.json error: error.message, 200



    app.post '/message', authorize('publish'), (req, res) ->


            fields.proto = "apns" + "|" + fields.appId

            createSubscriber fields, (subscriber, created) ->

                if created == false
                    subscriber.getSubscriptions (subs) ->
                        for sub in subs
                            subscriber.removeSubscription sub.event, (deleted) ->
                                if not deleted
                                    logger.error "No subscriber #{req.subscriber.id}"

                subscriber.get (info) ->
                    info.id = subscriber.id
                    if req.body.pushTopics?
