 	docker.getImage(app.imageId).inspectAsync()
 	.catch (error) ->
 		console.log("Pulling image:", app.imageId)
+		utils.mixpanelTrack('Application install', app)
 		docker.createImageAsync(fromImage: app.imageId)
 		.then (stream) ->
 			return new Promise (resolve, reject) ->

	return -> publishQueue.push(arguments)

exports.kill = kill = (app) ->
	docker.listContainersAsync(all: 1)
	.then (containers) ->
		Promise.all(


			# Delete all the ones to remove in one go
			Promise.map toBeRemoved, (imageId) ->
				kill(apps[imageId])
				.then ->
					knex('app').where('imageId', imageId).delete()
			.then ->
				# Then install the apps and add each to the db as they succeed
				installingPromises = toBeInstalled.map (imageId) ->
					app = remoteApps[imageId]
					start(app)
					.then ->
						knex('app').insert(app)
